fix(runtime): type runtime context and confirm summarization invariant (#2687)#2779
Draft
ShenAC-SAC wants to merge 3 commits intobytedance:mainfrom
Draft
fix(runtime): type runtime context and confirm summarization invariant (#2687)#2779ShenAC-SAC wants to merge 3 commits intobytedance:mainfrom
ShenAC-SAC wants to merge 3 commits intobytedance:mainfrom
Conversation
bytedance#2687) addresses bytedance#2687 item 5 and item 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
addresses #2687 item 5 and item 6
Summary
app_configexplicitly, removing the ambientget_app_config()fallback from both_build_middlewaresand_create_summarization_middleware.DeerFlowClient's preloadedself._app_configinto_build_middlewaresfor the embedded-client path.Invariant Audit (item 6)
This audit follows the config-threading direction established by the preceding #2687 PRs: config should be resolved at composition roots and then passed explicitly through runtime/middleware construction.
_build_middlewares: now requiresapp_configexplicitly and passes it to_create_summarization_middleware— safe.make_lead_agent→_make_lead_agent: passesresolved_app_configexplicitly to_build_middlewares— safe.DeerFlowClient._ensure_agent:DeerFlowClient.__init__preloads config, and_ensure_agentnow passesself._app_configinto_build_middlewares— safe.app_config; those tests now pass an explicitAppConfigor assert the bare helper call is invalid.Verdict: the explicit-config invariant is enforced in the target post-#2769/#2778 state. Summarization middleware construction has a single config path, matching item 2's removal of duplicate config sources instead of preserving ambient fallbacks.
File Summary
worker.py: typed runtime context helpers and documented cast boundary.task_tool.py: typed access to runtime config.agent.py: single explicitapp_configpath for middleware construction.client.py: embedded client passes its preloaded app config into middleware construction.test_lead_agent_model_resolution.py/test_client.py: regression coverage for explicit config threading and no bare helper calls.Merge Plan
mainafter those PRs land.make lintandmake testafter the rebase before marking ready for review.